package com.liujing.tacticspatten;

/**
 * @program: DesignPattenDemo
 * @description: 折扣金额
 * @author: liujing
 * @create: 2019-11-22 11:01
 **/
public class CashRebate extends CashSuper {
    private double cashRebate = 1d;

    public CashRebate(double cashRebate) {
        this.cashRebate = cashRebate;
    }

    @Override
    public double acceptCash(double money) {
        //返回打折后的金额
        return money * cashRebate;
    }
}
